package com.ctg.payroll2.action.common;

import java.util.List;

import com.ctg.payroll2.action.BaseAction;
import com.ctg.payroll2.bean.common.ColumnModel;
import com.ctg.payroll2.bean.common.StoreField;
import com.ctg.payroll2.bean.filter.payment.PayClazzItemFilter;
import com.ctg.payroll2.service.common.PayrollUtilService;

public class DynamicColumnAction extends BaseAction {
	private List<ColumnModel> columnModelList;
	private List<StoreField> storeFieldList;
	private PayClazzItemFilter filter;
	private PayrollUtilService payrollUtilService;
	
	private Long payClassId; //薪资类别
	private String payMonth; //薪资月份
	/*
	 * 查询类型 "columnModel" Grid表头内容, "storeField" store字段名 
	 */
	private String queryType;
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void commonOperations() {

	}

	@Override
	protected void createEntity() {

	}

	@Override
	protected void deleteEntity() {

	}

	@Override
	protected void exportXLS() {

	}
	
	/*
	 * 获取grid表头信息
	 */
	protected List<ColumnModel> queryColumnModelList(){
		return payrollUtilService.queryColumnModelList(payClassId);
	}
	protected List<ColumnModel> queryColumnModelListHis(){
		return payrollUtilService.queryColumnModelListHis(filter);
	}
	/*
	 * 获取grid字段信息
	 */
	protected List<StoreField> queryStoreFieldList(){
		return payrollUtilService.queryStoreFieldList(payClassId);
	}

	@Override
	protected void queryEntity() {
		if(queryType.equals("columnModel")){
			columnModelList = queryColumnModelList();
		}else if(queryType.equals("storeField")){
			storeFieldList = queryStoreFieldList();
		}else if(queryType.equals("columnModelHis")){
			columnModelList = queryColumnModelListHis();
		}
	}

	@Override
	protected void retrieveEntity() {

	}

	@Override
	protected void updateEntity() {

	}

	public List<ColumnModel> getColumnModelList() {
		return columnModelList;
	}

	public void setColumnModelList(List<ColumnModel> columnModelList) {
		this.columnModelList = columnModelList;
	}

	public List<StoreField> getStoreFieldList() {
		return storeFieldList;
	}

	public void setStoreFieldList(List<StoreField> storeFieldList) {
		this.storeFieldList = storeFieldList;
	}

	public void setPayrollUtilService(PayrollUtilService payrollUtilService) {
		this.payrollUtilService = payrollUtilService;
	}

	public Long getPayClassId() {
		return payClassId;
	}

	public void setPayClassId(Long payClassId) {
		this.payClassId = payClassId;
	}

	public String getPayMonth() {
		return payMonth;
	}

	public void setPayMonth(String payMonth) {
		this.payMonth = payMonth;
	}

	public String getQueryType() {
		return queryType;
	}

	public void setQueryType(String queryType) {
		this.queryType = queryType;
	}

	public PayClazzItemFilter getFilter() {
		return filter;
	}

	public void setFilter(PayClazzItemFilter filter) {
		this.filter = filter;
	}

}
